from element.info.login.login_pages import LoginPages


# 登陆动作
class LoginAction:
    def __init__(self, driver):
        self.login_page = LoginPages(driver)

    def login_action(self, username, password):
        """输入用户名->输入密码->点击登陆按钮"""
        self.login_page.input("username", username)
        self.login_page.input("password", password)
        self.login_page.click("login_button")
        self.login_page.impl_wait()

    def clear_input(self):
        """清空用户框->清空密码框"""
        self.login_page.clear("username")
        self.login_page.clear("password")
